package com.bskj.kuaifu.service;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.bskj.common.bean.model.ParkInfo;
import com.bskj.common.service.IBaseService;
import com.bskj.kuaifu.bean.vo.req.ConfirmReceiveMoneyReqVo;
import com.bskj.kuaifu.bean.vo.req.GetCarNoInfoReqVo;
import com.bskj.kuaifu.bean.vo.req.OfflineDataBackupReqVo;
import com.bskj.kuaifu.bean.vo.req.ParkReqVo;
import com.bskj.kuaifu.bean.vo.resp.ParkinfoAppealVo;
import com.bskj.kuaifu.bean.vo.resp.UserMoneyLogRespVo;
import com.bskj.kuaifu.bean.vo.resp.UserParkInfoRespVo;
import com.bskj.kuaifu.bean.vo.resp.UserUnPayDetailRespVo;

/**
 * 停车计费相关服务
 * 
 * @author lishi
 * @date 2017-11-29 下午4:04:10
 */
public interface IParkInfoService extends IBaseService<ParkInfo> {
	/**
	 * 停车扣费
	 * 
	 * @param reqVo 停车请求入参
	 * @return
	 * @throws Exception
	 */
	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> carOut(ParkReqVo reqVo,String ip) throws Exception;
	
	/**
	 * 车辆进场
	 * 
	 * @param reqVo 车场进场参数
	 * @return
	 * @throws Exception
	 */
	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> carIn(GetCarNoInfoReqVo reqVo) throws Exception;

	/**
	 * 确认收费
	 * 
	 * @param reqVo 确认收费请求入参
	 * @return
	 * @throws Exception
	 */
	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> confirmReceiveMoney(ConfirmReceiveMoneyReqVo reqVo, String ip) throws Exception;


	/**
	 * 获取用户停车记录
	 * 
	 * @param userId
	 * @param lastId
	 * @return
	 * @throws Exception
	 */
	List<UserParkInfoRespVo> getUserParkInfo(int userId, Integer lastId) throws Exception;

	/**
	 * 当用户余额小于0时。获取用户未支付的详情（未支付的单，已经最后一次余额为小于0的单）
	 * 
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	UserUnPayDetailRespVo getUnPayDetail(int userId) throws Exception;
	
	/**
	 * 查找停车信息
	 * 
	 * @param outTradeNo
	 * @return
	 * @throws Exception
	 */
	ParkInfo getParkInfo(String outTradeNo)throws Exception;
	
	/**
	 * 查找用户的停车信息
	 * 
	 * @param userId
	 * @param userMoneyChangeTypeEnum
	 * @param page
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<UserMoneyLogRespVo> getUserMoneyLog(Integer userId,
             Integer page, Integer pageSize) throws Exception;
	
	/**
	 * 处理离线数据
	 * 
	 * @param reqVo
	 * @throws Exception
	 */
	void checkOfflineData(OfflineDataBackupReqVo reqVo)throws Exception;
	
	
	/**
	 * 查找停车记录
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public ParkinfoAppealVo getParkinfoAppealVo(Integer id)throws Exception;
}
